/// <reference path="../types.ts" />
/// <reference path="../helpers.ts" />
/// <reference path="organization.ts" />

module $Xrm.Messages {
    export class AssignRequest extends OrganizationRequest {
        public Assignee: EntityReference = null;
        public Target: EntityReference = null;

        constructor() {
            super("Assign", "b"); // namespace is 'b' because this request is from crm4 days
        }

        GetResponse(responseXml: Document): AssignResponse {
            return new AssignResponse(responseXml);
        }

        ToSoapXml(): string {
            this.Parameters["Target"] = this.Target;
            this.Parameters["Assignee"] = this.Assignee;

            return super.ToSoapXml();
        }
    }

    export class AssignResponse extends OrganizationResponse {
        constructor(responseXml?: Document) {
            super("Assign", responseXml);
        }
    }
}